import { PageModel } from './common';

class RoleModel {
  public clientId: string;
  public createBy: string;
  public defaultRole: boolean;
  public description: string;
  public enabled: boolean;
  public id: string;
  public name: string;
  public namespace: string;
  public type: number;
  public createAt: number;
  public updateAt: number;
  public updateBy: string;
}

class PermissionGroupModel {
  public addinId: string;
  public addinKeyPrefix: string;
  public alias: string;
  public enabled: boolean;
  public location: number;
  public name: string;
  public order: number;
  public type: number;
  public url: string;
  public permissions: PermissionModel;
}

class PermissionModel {
  public createAt: number;
  public createBy: string;
  public description: string;
  public id: string;
  public label: string;
  public level: number;
  public name: string;
  public updateAt: number;
  public updateBy: number;
}

class FolderPermissionModel {
  public actorUrn: string;
  public createAt: number;
  public id: string;
  public inheriting: boolean;
  public parentPermissionKeys: string;
  public permissionCatalogKeys: string;
  public permissionKeys: string[];
  public resourceUrn: string;
  public updateAt: number;
}

class FolderPermissionPageModel extends PageModel {
  public data: FolderItemModel;
}

class FolderItemModel {
  public items: FolderPermissionModel[];
}

export {
  RoleModel,
  PermissionGroupModel,
  FolderPermissionModel,
  FolderPermissionPageModel
};
